package com.javasm.service.stockService.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.javasm.domin.entity.stockEntity.PutStorageImel;
import com.javasm.mapper.stockMapper.PutStorageImelMapper;
import com.javasm.service.stockService.PutStorageImelService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
* @author Administrator
* @description 针对表【stock_purchase_put_storage_imel(入库商品串号)】的数据库操作Service实现
* @createDate 2021-11-24 21:40:27
*/
@Service
@Transactional

public class PutStorageImelServiceImpl extends ServiceImpl<PutStorageImelMapper, PutStorageImel>
    implements PutStorageImelService {

    @Resource
    private PutStorageImelMapper putStorageImelMapper;

    @Override
    public String findImelListById(Integer id) {
        List<PutStorageImel> imelListById = putStorageImelMapper.findImelListById(id);
        StringBuilder buffer = new StringBuilder();
        for (int i = 0; i < imelListById.size(); i++) {
            if (i==imelListById.size()-1){
                buffer.append(imelListById.get(i).getPutStorageImel());
            }else {
                buffer.append(imelListById.get(i).getPutStorageImel()).append("\n");
            }
        }
        return buffer.toString();
    }
}




